//
//  RBMeWebViewController.m
//  Budejie
//
//  Created by 华杨科技 on 2017/10/13.
//  Copyright © 2017年 饶波. All rights reserved.
//

#import "RBMeWebViewController.h"

@interface RBMeWebViewController () <UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *backItem;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *forwardItem;

@end

@implementation RBMeWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
 
    NSLog(@"%@",self.url);
 
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
    self.webView.delegate = self;
}

#pragma mark - <UIWebViewDelegate>
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    self.backItem.enabled = webView.canGoBack;
    self.forwardItem.enabled = webView.canGoForward;
}

- (IBAction)backAction {
    
    [self.webView goBack];
}

- (IBAction)forwardAction {
    [self.webView goForward];
}

- (IBAction)refreshAction {
    [self.webView reload];
}


@end
